class CreateVehicleRentRecords < ActiveRecord::Migration
  def self.up
    create_table :vehicle_rent_records, :force => true do |t|
      t.references :vehicle, :null => false
      t.date :day, :null => false
      t.timestamps
    end
    
    execute "alter table vehicle_rent_records 
             add constraint fk_vehicle_rent_record_vehicle
             foreign key (vehicle_id) references vehicles(id)"
  end
  
  def self.down
    drop_table :vehicle_rent_records
  end
end
